<%-- 
    Document   : content_quicksearch
    Created on : Nov 27, 2011, 11:28:31 PM
    Author     : Ngoc Linh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="main_content_panel" id="box_listproduct">
    <p class="top_main_content_panel">
        Danh sách sản phẩm đã xem (<span style="color: black;">${sessionScope.SanPhamVuaXem.size()}</span>)
    </p>
    <div class="content_main_content_panel">
        <c:choose>
            <c:when test="${not empty sessionScope.SanPhamVuaXem}">
                <div class="list_products">
                    <c:forEach var="sp" items="${sessionScope.SanPhamVuaXem}">
                        <div class="product_item">
                            <c:url value="product.do" var="linkDetailPro">
                                <c:param name="masp" value="${sp.maSanPham}"></c:param>
                            </c:url>
                            <p class="name_product">    
                                <a href="${linkDetailPro}" title="Xem chi tiết">
                                    ${sp.tenSanPham}
                                </a>                                
                            </p>
                            <p class="image_product">
                                <a href="${linkDetailPro}" title="Xem chi tiết">
                                    <img src="${sp.hinhMoTa}" alt="${sp.tenSanPham}" width="110px" height="110px" />
                                </a>
                            </p>
                            <div class="info_product">
                                <p class="timedown_product" id="countdown_${sp.maSanPham}_l"></p>
                                <p class="timeend_product">
                                    <fmt:formatDate value="${sp.ngayHetHan}" pattern="dd/MM/yyyy HH:mm:ss"></fmt:formatDate>
                                </p>
                                <p class="price_product">
                                    <fmt:formatNumber pattern="###,###" value="${sp.giaHienTai}"></fmt:formatNumber><span>đ</span>
                                </p>
                            </div>                                
                            <p class="datgia">
                                <a href="${linkDetailPro}"> <img src="images/btn_datgia.png" alt="" /></a>
                            </p>
                            <fmt:formatDate pattern="MM/dd/yyyy HH:mm:ss" value="${sp.ngayHetHan}" var="dateEnd"></fmt:formatDate>
                            <script type="text/javascript"> 
                                GetCount(new Date('${dateEnd}'), 'countdown_${sp.maSanPham}_l' );
                            </script>
                        </div>
                    </c:forEach>
                </div>
            </c:when>
            <c:otherwise>
                Bạn chưa xem sản phẩm nào.
            </c:otherwise>
        </c:choose>
    </div>
</div>
